package com.example.guetdemo.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.guetdemo.domain.dto.CodeDto;
import com.example.guetdemo.domain.dto.LoginDto;
import com.example.guetdemo.domain.dto.RegisterDto;
import com.example.guetdemo.domain.entity.User;
import com.example.guetdemo.result.ResponseResult;
import com.google.zxing.WriterException;
import org.springframework.http.ResponseEntity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.Map;

/**
 * (User)表服务接口
 */
public interface UserService extends IService<User> {

    ResponseResult register(RegisterDto registerDto);

    ResponseResult userLogin(LoginDto loginDto, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);

    ResponseResult getUserList();

    ResponseResult sendCode(CodeDto codeDto);

    ResponseResult verifyCode(CodeDto codeDto);
    
    ResponseEntity<byte[]> generateQRUUID(HttpServletResponse httpServletResponse) throws IOException, WriterException;

    ResponseResult scanQRCode(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException;

    ResponseResult checkQRCode(HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);

    ResponseResult confrimQRLogin(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);

    ResponseResult confirmQRLoginWebsocket(HttpSession httpSession ,HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException;
}
